﻿using System.Data;
using iLib.DataAccess;

namespace Cms.Utilities.DatabaseUpdaters
{
    internal class SqlServer2005Updater : DatabaseUpdater
    {
        internal SqlServer2005Updater(string connectionString)
        {
            Dam = new SqlClientManager(connectionString);
        }

        private SqlServer2005Updater()
        {
        }

        public override void Patch_0_9_12325_471()
        {
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (56, 'CustomizeEditor', 26, NULL)");
            Dam.ExecuteQuery("ALTER TABLE cmsAdministratorGroup ADD DefaultCustomAdminPageAccess nvarchar(255) NOT NULL DEFAULT ('Deny')");
            Dam.ExecuteQuery("ALTER TABLE cmsRssFeed ADD RemoveImgTags bit NOT NULL DEFAULT (0)");
            Dam.ExecuteQuery("ALTER TABLE cmsRssFeed ADD SortMode nvarchar(20) NOT NULL DEFAULT ('PublishedTimestamp')");
            Dam.ExecuteQuery("ALTER TABLE cmsAdministrator ADD FirstDayOfWeek int NULL");
        }

        public override void Patch_0_9_12310_469()
        {
            Dam.ExecuteQuery("ALTER TABLE cmsRssFeed ADD ContentDisplayMode nvarchar(20) NOT NULL DEFAULT ('Complete')");
        }

        public override void Patch_0_9_12309_468()
        {
            Dam.ExecuteQuery("ALTER TABLE cmsCategory ALTER COLUMN FolderName nvarchar(255) NULL");
        }

        public override void Patch_0_9_12309_464()
        {
            Dam.ExecuteQuery("CREATE TABLE cmsRssFeed (" +
                                    "ID int IDENTITY(1, 1) NOT NULL PRIMARY KEY CLUSTERED, " +
                                    "[Name] [nvarchar](255) NOT NULL, " +
                                    "[Description] [nvarchar](max) NOT NULL, " +
                                    "[Filename] [nvarchar](255) NOT NULL, " +
                                    "[SiteID] [int] NOT NULL REFERENCES cmsSite (ID), " +
                                    "[ContentDisplayPageID] [int] NOT NULL REFERENCES cmsPage (ID)" +
                                ")");
            Dam.ExecuteQuery("CREATE TABLE cmsRssFeedCategory (" +
                                    "[RssFeedID] [int] NOT NULL REFERENCES cmsRssFeed (ID), " +
                                    "[CategoryID] [int] NOT NULL REFERENCES cmsCategory (ID)" +
                                ")");
            Dam.ExecuteQuery("CREATE TABLE cmsRssFeedRequiredUserGroup (" +
                                    "[RssFeedID] [int] NOT NULL REFERENCES cmsRssFeed (ID), " +
                                    "[GroupID] [int] NOT NULL REFERENCES cmsUserGroup (ID)" +
                                ")");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (52, 'RssFeeds', 25, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (53, 'AddRssFeed', 1, 52)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (54, 'EditRssFeed', 2, 52)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (55, 'DeleteRssFeed', 3, 52)");
            Dam.ExecuteQuery("ALTER TABLE cmsContentTranslation ADD FirstPublished [datetime] NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsContentTranslation ADD LatestPublished [datetime] NULL");
        }

        public override void Patch_0_9_12303_463()
        {
        }

        public override void Patch_0_9_12297_462()
        {
            Dam.ExecuteQuery("ALTER TABLE cmsAuditLog ADD AdministratorID [int] NOT NULL DEFAULT(0)");
        }

        public override void Patch_0_9_12256_457()
        {
            SqlClientParameterCollection parameters;
            ParameterCollectionWrapper wrapper;
            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "cmsUserGroupMembership");
            parameters.Add("@newname", "cmsMembership");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            Dam.ExecuteQuery("CREATE TABLE cmsAdministratorClosedFolder (" +
                                "AdministratorId int NOT NULL REFERENCES cmsAdministrator (ID), " +
                                "FolderId int NOT NULL REFERENCES cmsFolder (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE cmsAdministratorClosedMediaFolder (" +
                                "AdministratorId int NOT NULL REFERENCES cmsAdministrator (ID), " +
                                "MediaFolderId int NOT NULL REFERENCES cmsMediaFolder (ID)" +
                              ")");
        }

        public override void Patch_0_9_12216_454()
        {
            Dam.ExecuteQuery("CREATE TABLE cmsFieldType (" +
                                    "Id int NOT NULL PRIMARY KEY CLUSTERED, " +
                                    "[Name] [nvarchar](255) NOT NULL, " +
                                    "[IsValueset] [bit] NOT NULL DEFAULT (0), " +
                                    "[SortIndex] [int] NOT NULL" +
                                ")");
            Dam.ExecuteQuery("INSERT INTO cmsFieldType ([Id], [Name], [IsValueset], [SortIndex]) VALUES (1, 'Username', 0, 1)");
            Dam.ExecuteQuery("INSERT INTO cmsFieldType ([Id], [Name], [IsValueset], [SortIndex]) VALUES (2, 'Password', 0, 2)");
            Dam.ExecuteQuery("INSERT INTO cmsFieldType ([Id], [Name], [IsValueset], [SortIndex]) VALUES (3, 'Email', 0, 3)");
            Dam.ExecuteQuery("INSERT INTO cmsFieldType ([Id], [Name], [IsValueset], [SortIndex]) VALUES (4, 'TextSingleRow', 0, 4)");
            Dam.ExecuteQuery("INSERT INTO cmsFieldType ([Id], [Name], [IsValueset], [SortIndex]) VALUES (5, 'TextMultipleRows', 0, 5)");
            Dam.ExecuteQuery("CREATE TABLE cmsUserGroupField (" +
                                    "Id int IDENTITY(1, 1) NOT NULL PRIMARY KEY CLUSTERED, " +
                                    "UserGroupId int NOT NULL REFERENCES cmsUserGroup (ID), " +
                                    "FieldTypeId int NOT NULL REFERENCES cmsFieldType (Id), " +
                                    "[Name] [nvarchar](255) NOT NULL, " +
                                    "[SortIndex] [int] NOT NULL" +
                                ")");
            Dam.ExecuteQuery("CREATE TABLE cmsUserGroupFieldLabelTranslation (" +
                                    "UserGroupFieldId int NOT NULL REFERENCES cmsUserGroupField (Id), " +
                                    "LocaleId int NOT NULL REFERENCES cmsLocale (ID), " +
                                    "[Text] [nvarchar](255) NOT NULL" +
                                ")");
        }

        public override void Patch_0_9_12165_446()
        {
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (49, 'Users', 24, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (50, 'EditUser', 1, 49)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (51, 'AddUser', 2, 49)");
            Dam.ExecuteQuery("ALTER TABLE cmsUser ADD DeliveryStreetAddress [nvarchar](255) NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsUser ADD DeliveryPostalCode [nvarchar](255) NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsUser ADD DeliveryTown [nvarchar](255) NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsUser ADD DeliveryCountry [nvarchar](255) NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsUser ADD InvoiceStreetAddress [nvarchar](255) NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsUser ADD InvoicePostalCode [nvarchar](255) NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsUser ADD InvoiceTown [nvarchar](255) NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsUser ADD InvoiceCountry [nvarchar](255) NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsUser ADD Phone [nvarchar](255) NULL");
        }

        public override void Patch_0_9_12141_437()
        {
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (7, 'Administrators', 6, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (8, 'AdministratorGroups', 7, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (9, 'Plugins', 8, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (10, 'PluginTemplates', 1, 9)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (11, 'EditPluginTemplate', 1, 10)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (12, 'EditPluginTemplateLiterals', 1, 10)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (13, 'Comments', 9, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (14, 'EditUserGroup', 1, 6)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (15, 'Categories', 10, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (16, 'EditCategory', 1, 15)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (17, 'EditAdministratorGroup', 1, 8)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (18, 'EditAdministrator', 1, 7)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (19, 'CustomAdminPages', 11, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (20, 'EditCustomAdminPage', 1, 19)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (21, 'EditFolder', 2, 2)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (22, 'EditPage', 3, 2)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (23, 'EditApplicationPage', 4, 2)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (24, 'Stylesheets', 12, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (25, 'EditStylesheet', 1, 24)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (26, 'Update', 13, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (27, 'Locales', 14, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (28, 'EditLocale', 1, 27)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (29, 'DashboardGadgets', 15, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (30, 'EditSite', 1, 4)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (31, 'MasterTemplates', 16, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (32, 'EditMasterTemplate', 1, 31)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (33, 'DetailTemplates', 17, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (34, 'EditDetailTemplate', 1, 33)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (35, 'Applications', 18, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (36, 'EditApplication', 1, 35)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (37, 'ApplicationPages', 2, 35)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (38, 'SearchContent', 19, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (39, 'EditContent', 20, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (40, 'EditCustomDashboardGadget', 21, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (41, 'Menus', 22, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (42, 'EditMenu', 1, 41)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (43, 'EditMenuItem', 1, 42)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (44, 'Media', 23, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (45, 'Upload', 1, 44)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (46, 'EditMediaFolder', 2, 44)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (47, 'EditMediaFile', 3, 44)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (48, 'EditContentPreview', 1, 38)");
        }

        public override void Patch_0_9_12114_419()
        {
            Dam.ExecuteQuery("DROP TABLE cmsApplicationAdminPage");
            Dam.ExecuteQuery("CREATE TABLE cmsCustomAdminPage (" +
                                    "ID int IDENTITY(1, 1) NOT NULL PRIMARY KEY CLUSTERED, " +
                                    "[Name] [nvarchar](255) NOT NULL, " +
                                    "[Filename] [nvarchar](255) NOT NULL, " +
                                    "[ShowInMenu] [bit] NOT NULL DEFAULT (0), " +
                                    "[SiteID] [int] NULL REFERENCES cmsSite (ID), " +
                                    "[CodeID] [int] NULL REFERENCES cmsSourceCode (ID), " +
                                    "[XmlTranslationsID] [int] NULL REFERENCES cmsSourceCode (ID) " +
                                ")");
            Dam.ExecuteQuery("CREATE TABLE cmsAdministratorGroupAllowedCustomAdminPage (" +
                                    "[GroupID] [int] NOT NULL REFERENCES cmsAdministratorGroup (ID), " +
                                    "[CustomAdminPageID] [int] NOT NULL REFERENCES cmsCustomAdminPage (ID) " +
                                ")");
            Dam.ExecuteQuery("CREATE TABLE cmsAdministratorGroupDeniedCustomAdminPage (" +
                                    "[GroupID] [int] NOT NULL REFERENCES cmsAdministratorGroup (ID), " +
                                    "[CustomAdminPageID] [int] NOT NULL REFERENCES cmsCustomAdminPage (ID) " +
                                ")");
        }

        public override void Patch_0_9_12078_398()
        {
            Dam.ExecuteQuery("CREATE TABLE cmsMasterTemplatePageArea (" +
                                "MasterTemplateID int NOT NULL REFERENCES cmsMasterTemplate (ID), " +
                                "AreaID nvarchar(255) NULL" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE cmsMasterTemplateArea (" +
                                "MasterTemplateID int NOT NULL REFERENCES cmsMasterTemplate (ID), " +
                                "AreaID nvarchar(255) NULL" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE cmsDetailTemplateArea (" +
                                "DetailTemplateID int NOT NULL REFERENCES cmsDetailTemplate (ID), " +
                                "AreaID nvarchar(255) NULL" +
                              ")");
        }

        public override void Patch_0_9_12073_394()
        {
            Dam.ExecuteQuery("ALTER TABLE cmsPageLocalizedProperty ADD ListingsTitle [nvarchar](255) NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsPageLocalizedProperty ADD ListingsDescription [nvarchar](max) NULL");
        }

        public override void Patch_0_9_12052_387()
        {
            Dam.ExecuteQuery("CREATE TABLE cmsAuditLog (" +
                              "ID bigint NOT NULL IDENTITY(1, 1) PRIMARY KEY CLUSTERED, " +
                              "[Action] varchar(10) NOT NULL, " +
                              "EntityType varchar(255) NOT NULL, " +
                              "EntityID int NOT NULL, " +
                              "[Message] text NOT NULL, " +
                              "UserID int NOT NULL, " +
                              "Created datetime NOT NULL" +
                              ")");
        }

        public override void Patch_0_9_12026_376()
        {
            SqlClientParameterCollection parameters;
            ParameterCollectionWrapper wrapper;
            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "cmsUserGroupAllowedContent");
            parameters.Add("@newname", "cmsContentRequiredUserGroup");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "cmsUserGroupAllowedFolder");
            parameters.Add("@newname", "cmsFolderRequiredUserGroup");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "cmsUserGroupAllowedMediaFile");
            parameters.Add("@newname", "cmsMediaFileRequiredUserGroup");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "cmsUserGroupAllowedMediaFolder");
            parameters.Add("@newname", "cmsMediaFolderRequiredUserGroup");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "cmsUserGroupAllowedPage");
            parameters.Add("@newname", "cmsPageRequiredUserGroup");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "cmsUserGroupDeniedContent");
            parameters.Add("@newname", "cmsContentDeselectedUserGroup");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "cmsUserGroupDeniedFolder");
            parameters.Add("@newname", "cmsFolderDeselectedUserGroup");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "cmsUserGroupDeniedMediaFolder");
            parameters.Add("@newname", "cmsMediaFolderDeselectedUserGroup");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "cmsUserGroupDeniedMediaFile");
            parameters.Add("@newname", "cmsMediaFileDeselectedUserGroup");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "cmsUserGroupDeniedPage");
            parameters.Add("@newname", "cmsPageDeselectedUserGroup");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
        }
        
        public override void Patch_0_9_12021_372()
        {
            Dam.ExecuteQuery("CREATE TABLE [cmsScheduledPublishing] (" +
                              "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                              "[ContentTranslationVersionID] [int] NOT NULL REFERENCES cmsContentTranslationVersion (ID), " +
                              "[Timestamp] [nvarchar](255) NOT NULL, " +
                              "[Description] [nvarchar](255) NULL" +
                              ")");
        }

        public override void Patch_0_9_12016_369()
        {
            Dam.ExecuteQuery("ALTER TABLE cmsDetailTemplate ADD TemplateDescription [nvarchar](max) NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsMasterTemplate ADD TemplateDescription [nvarchar](max) NULL");
        }

        public override void Patch_0_9_11229_341()
        {
            Dam.ExecuteQuery("ALTER TABLE cmsAdministrator ADD CurrentSiteLocaleID int NULL REFERENCES cmsLocale (ID)");
        }

        public override void Patch_0_9_11227_337()
        {
            Dam.ExecuteQuery("ALTER TABLE cmsUserGroupMembership ADD [StartDate] [datetime] NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsUserGroupMembership ADD [EndDate] [datetime] NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsUserGroup ADD [LoginPageID] [int] NULL REFERENCES cmsPage (ID)");
            Dam.ExecuteQuery("ALTER TABLE cmsUserGroup ADD [StartPageID] [int] NULL REFERENCES cmsPage (ID)");
            Dam.ExecuteQuery("ALTER TABLE cmsUser ALTER COLUMN [Firstname] [nvarchar](255) NULL");
            Dam.ExecuteQuery("ALTER TABLE cmsUser ALTER COLUMN [Lastname] [nvarchar](255) NULL");
        }
        
        public override void Patch_0_9_11170_327()
        {
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (5, 'PublishContent', 4, NULL)");
            Dam.ExecuteQuery("INSERT INTO cmsPermission ([ID], [Name], [SortIndex], [ParentID]) VALUES (6, 'UserGroups', 5, NULL)");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUser] (" +
                              "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                              "[Username] [nvarchar](255) NOT NULL, " +
                              "[Password] [nvarchar](255) NOT NULL, " +
                              "[Email] [nvarchar](255) NOT NULL, " +
                              "[Firstname] [nvarchar](255) NOT NULL, " +
                              "[Lastname] [nvarchar](255) NOT NULL, " +
                              "[Deleted] [bit] NOT NULL, " +
                              "[Created] [datetime] NOT NULL, " +
                              "[FirstLogin] [datetime] NULL, " +
                              "[LatestLogin] [datetime] NULL, " +
                              "[ForceLogout] [bit] NOT NULL" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUserGroup] (" +
                              "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                              "[Name] [nvarchar](255) NOT NULL" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUserGroupMembership] (" +
                              "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                              "[UserID] [int] NOT NULL REFERENCES cmsUser (ID), " +
                              "[UserGroupID] [int] NOT NULL REFERENCES cmsUserGroup (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUserGroupAllowedPage] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsUserGroup (ID), " +
                              "[PageID] [int] NOT NULL REFERENCES cmsPage (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUserGroupDeniedPage] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsUserGroup (ID), " +
                              "[PageID] [int] NOT NULL REFERENCES cmsPage (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUserGroupAllowedFolder] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsUserGroup (ID), " +
                              "[FolderID] [int] NOT NULL REFERENCES cmsFolder (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUserGroupDeniedFolder] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsUserGroup (ID), " +
                              "[FolderID] [int] NOT NULL REFERENCES cmsFolder (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsAdministratorGroupAllowedFolder] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsAdministratorGroup (ID), " +
                              "[FolderID] [int] NOT NULL REFERENCES cmsFolder (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsAdministratorGroupDeniedFolder] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsAdministratorGroup (ID), " +
                              "[FolderID] [int] NOT NULL REFERENCES cmsFolder (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUserGroupAllowedMediaFolder] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsUserGroup (ID), " +
                              "[FolderID] [int] NOT NULL REFERENCES cmsMediaFolder (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUserGroupDeniedMediaFolder] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsUserGroup (ID), " +
                              "[FolderID] [int] NOT NULL REFERENCES cmsMediaFolder (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsAdministratorGroupAllowedMediaFolder] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsAdministratorGroup (ID), " +
                              "[FolderID] [int] NOT NULL REFERENCES cmsMediaFolder (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsAdministratorGroupDeniedMediaFolder] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsAdministratorGroup (ID), " +
                              "[FolderID] [int] NOT NULL REFERENCES cmsMediaFolder (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUserGroupAllowedMediaFile] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsUserGroup (ID), " +
                              "[FileID] [int] NOT NULL REFERENCES cmsMediaFile (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUserGroupDeniedMediaFile] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsUserGroup (ID), " +
                              "[FileID] [int] NOT NULL REFERENCES cmsMediaFile (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsAdministratorGroupAllowedMediaFile] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsAdministratorGroup (ID), " +
                              "[FileID] [int] NOT NULL REFERENCES cmsMediaFile (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsAdministratorGroupDeniedMediaFile] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsAdministratorGroup (ID), " +
                              "[FileID] [int] NOT NULL REFERENCES cmsMediaFile (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUserGroupAllowedContent] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsUserGroup (ID), " +
                              "[ContentID] [int] NOT NULL REFERENCES cmsContent (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsUserGroupDeniedContent] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsUserGroup (ID), " +
                              "[ContentID] [int] NOT NULL REFERENCES cmsContent (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsAdministratorGroupAllowedContent] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsAdministratorGroup (ID), " +
                              "[ContentID] [int] NOT NULL REFERENCES cmsContent (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [dbo].[cmsAdministratorGroupDeniedContent] (" +
                              "[GroupID] [int] NOT NULL REFERENCES cmsAdministratorGroup (ID), " +
                              "[ContentID] [int] NOT NULL REFERENCES cmsContent (ID)" +
                              ")");
        }
        
        public override void Patch_0_9_11163_317()
        {
            Dam.ExecuteQuery("CREATE TABLE [cmsComment] (" +
                              "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                              "[PageID] [int] NOT NULL REFERENCES cmsPage (ID), " +
                              "[LocaleID] [int] NOT NULL REFERENCES cmsLocale (ID), " +
                              "[ContentID] [int] NULL REFERENCES cmsContent (ID), " +
                              "[Name] [nvarchar](255) NOT NULL, " +
                              "[Text] [nvarchar](max) NULL, " +
                              "[Approved] [bit] NOT NULL, " +
                              "[Created] [datetime] NOT NULL" +
                              ")");
        }
        
        public override void Patch_0_9_11139_313()
        {
            Dam.ExecuteQuery("CREATE TABLE [cmsDashboardGadget] (" +
                              "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                              "[ClassName] [nvarchar](255) NOT NULL, " +
                              "[AssemblyName] [nvarchar](max) NULL, " +
                              "[Activated] [bit] NOT NULL DEFAULT (1)" +
                              ")");
        }
        
        public override void Patch_0_9_11137_306()
        {
        }
        
        public override void Patch_0_9_11133_300()
        {
            Dam.ExecuteQuery("ALTER TABLE fpMenu ADD ExtraWrapperSpans int NOT NULL DEFAULT(0)");
        }
        
        public override void Patch_0_9_11095_265()
        {
            Dam.ExecuteQuery("EXEC sp_rename 'fpMediaFileDescription', 'fpMediaFileLocalizedProperty'");
        }

        public override void Patch_0_9_11095_264()
        {
            Dam.ExecuteQuery(
                "ALTER TABLE [fpMenuItem] ADD [ActiveForPagesInCategoryID] [int] NULL REFERENCES fpPageCategory (ID)");
        }

        public override void Patch_0_9_11095_262()
        {
            string sql = "CREATE TABLE [fpMediaFileDescription] (" +
                               "[MediaFileID] [int] NOT NULL REFERENCES fpMediaFile (ID), " +
                               "[LocaleID] [int] NOT NULL REFERENCES fpLocale (ID), " +
                               "[Title] [nvarchar](255) NOT NULL, " +
                               "[Description] [nvarchar](max) NULL, " +
                               "CONSTRAINT PK_fpMediaFileDescription PRIMARY KEY (MediaFileID, LocaleID)" +
                               ")";
            Dam.ExecuteQuery(sql);
        }

        public override void Patch_0_9_11064_247()
        {
            string sql = "CREATE TABLE [fpAdministratorAvailableSites] (" +
                         "[AdministratorID] [int] NOT NULL REFERENCES fpAdministrator (ID), " +
                         "[SiteID] [int] NOT NULL REFERENCES fpSite (ID), " +
                         "CONSTRAINT PK_fpAdministratorAvailableSites PRIMARY KEY (AdministratorID, SiteID)" +
                         ")";
            Dam.ExecuteQuery(sql);
        }
        
        public override void Patch_0_9_10243_211()
        {
            SqlClientParameterCollection parameters;
            ParameterCollectionWrapper wrapper;
            Dam.ExecuteQuery(
                "ALTER TABLE [fpPageCategories] ADD [DefaultSortKey] [nvarchar](20) NOT NULL DEFAULT('None')");
            Dam.ExecuteQuery(
                "ALTER TABLE [fpMediaCategories] ADD [DefaultSortKey] [nvarchar](20) NOT NULL DEFAULT('None')");
            Dam.ExecuteQuery(
                "ALTER TABLE [fpContentCategories] ADD [DefaultSortKey] [nvarchar](20) NOT NULL DEFAULT('None')");
            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "fpPageContent");
            parameters.Add("@newname", "fpPageContentX");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            Dam.ExecuteQuery("CREATE TABLE [fpPageContent] (" +
                              "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                              "[AreaID] [nvarchar](255) NOT NULL, " +
                              "[ContentID] [int] NOT NULL REFERENCES fpContent (ID), " +
                              "[PageID] [int] NOT NULL REFERENCES fpPages (ID)" +
                              ")");
            Dam.ExecuteQuery("INSERT INTO fpPageContent (AreaID, ContentID, PageID) " +
                              "SELECT AreaID, ContentID, PageID FROM fpPageContentX");
            Dam.ExecuteQuery("DROP TABLE fpPageContentX");

            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "fpMasterTemplateContent");
            parameters.Add("@newname", "fpMasterTemplateContentX");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            Dam.ExecuteQuery("CREATE TABLE [fpMasterTemplateContent] (" +
                              "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                              "[AreaID] [nvarchar](255) NOT NULL, " +
                              "[ContentID] [int] NOT NULL REFERENCES fpContent (ID), " +
                              "[MasterTemplateID] [int] NOT NULL REFERENCES fpMasterTemplates (ID)" +
                              ")");
            Dam.ExecuteQuery("INSERT INTO fpMasterTemplateContent (AreaID, ContentID, MasterTemplateID) " +
                              "SELECT AreaID, ContentID, MasterTemplateID FROM fpMasterTemplateContentX");
            Dam.ExecuteQuery("DROP TABLE fpMasterTemplateContentX");

            parameters = new SqlClientParameterCollection();
            parameters.Add("@objname", "fpDetailTemplateContent");
            parameters.Add("@newname", "fpDetailTemplateContentX");
            wrapper = new ParameterCollectionWrapper(parameters);
            Dam.ExecuteQuery("sp_rename", CommandType.StoredProcedure, ref wrapper);
            Dam.ExecuteQuery("CREATE TABLE [fpDetailTemplateContent] (" +
                              "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                              "[AreaID] [nvarchar](255) NOT NULL, " +
                              "[ContentID] [int] NOT NULL REFERENCES fpContent (ID), " +
                              "[DetailTemplateID] [int] NOT NULL REFERENCES fpDetailTemplates (ID)" +
                              ")");
            Dam.ExecuteQuery("INSERT INTO fpDetailTemplateContent (AreaID, ContentID, DetailTemplateID) " +
                              "SELECT AreaID, ContentID, DetailTemplateID FROM fpDetailTemplateContentX");
            Dam.ExecuteQuery("DROP TABLE fpDetailTemplateContentX");
        }
        
        public override void Patch_0_9_10237_191()
        {
            Dam.ExecuteQuery("ALTER TABLE [fpContent] ADD [Created] [datetime] NULL");
            Dam.ExecuteQuery("UPDATE [fpContent] SET [Created] = '2000-01-01'");
            Dam.ExecuteQuery("ALTER TABLE [fpContent] ALTER COLUMN [Created] [datetime] NOT NULL");
            Dam.ExecuteQuery("ALTER TABLE [fpContent] ADD [CreatedByID] [int] NULL REFERENCES fpAdministrators (ID)");
            DataTable dt = Dam.GetDataTable("SELECT TOP 1 ID FROM fpAdministrators");
            Dam.ExecuteQuery("UPDATE [fpContent] SET [CreatedByID] = " + dt.Rows[0]["ID"]);
            Dam.ExecuteQuery("ALTER TABLE [fpContent] ALTER COLUMN [CreatedByID] [int] NOT NULL");
            Dam.ExecuteQuery(
                "ALTER TABLE [fpMenuItemTranslations] ADD [DefaultHoverImageID] [int] NULL REFERENCES fpMediaFiles (ID)");
            Dam.ExecuteQuery(
                "ALTER TABLE [fpMenuItemTranslations] ADD [ActiveImageID] [int] NULL REFERENCES fpMediaFiles (ID)");
            Dam.ExecuteQuery(
                "ALTER TABLE [fpMenuItemTranslations] ADD [ActiveHoverImageID] [int] NULL REFERENCES fpMediaFiles (ID)");
        }
        
        public override void Patch_0_9_10237_184()
        {
            Dam.ExecuteQuery(
                "ALTER TABLE [fpDetailTemplates] ADD [DefaultMasterTemplateID] [int] NULL REFERENCES fpMasterTemplates (ID)");
        }
        
        public override void Patch_0_9_10232_183()
        {
            Dam.ExecuteQuery("ALTER TABLE [fpAdministrators] ADD [ShowIntroHelp] [bit] NOT NULL DEFAULT (1)");
        }
        
        public override void Patch_0_9_10232_182()
        {
            Dam.ExecuteQuery(
                "ALTER TABLE [fpAdministrators] ADD [SerializedSearchContentSettings] [nvarchar](max) NULL");
        }
        
        public override void Patch_0_9_10229_157()
        {
            Dam.ExecuteQuery("ALTER TABLE [fpMenus] ADD [ActiveItemPrefix] [nvarchar](255) NULL");
        }
        
        public override void Patch_0_8_10228_130()
        {
            Dam.ExecuteQuery(
                "ALTER TABLE [fpMenuItemTranslations] ADD [DefaultImageID] [int] NULL REFERENCES fpMediaFiles (ID)");
        }
        
        public override void Patch_0_8_10182_123()
        {
            Dam.ExecuteQuery("CREATE TABLE [fpMenus] (" +
                              "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                              "[Name] [nvarchar](255) NOT NULL, " +
                              "[Description] [nvarchar](max) NULL, " +
                              "[SiteID] [int] NOT NULL REFERENCES fpSites (ID), " +
                              "[SourceCodeID] [int] NOT NULL REFERENCES fpSourceCode (ID), " +
                              "[ItemIsActiveWhenSubItemIsActive] [bit] NOT NULL DEFAULT (1), " +
                              "[SubMenuBehaviour] [nvarchar](30) NOT NULL DEFAULT ('Toggle')" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [fpMenuVersions] (" +
                              "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                              "[Timestamp] [nvarchar](255) NOT NULL, " +
                              "[MenuID] [int] NOT NULL REFERENCES fpMenus (ID), " +
                              "[EditedByAdministratorID] [int] NOT NULL REFERENCES fpAdministrators (ID)" +
                              ")");
            Dam.ExecuteQuery("ALTER TABLE [fpMenus] ADD [PublishedVersionID] [int] NULL REFERENCES fpMenuVersions (ID)");
            Dam.ExecuteQuery("CREATE TABLE [fpMenuItems] (" +
                              "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                              "[MenuVersionID] [int] NOT NULL REFERENCES fpMenuVersions (ID), " +
                              "[ParentID] [int] NULL REFERENCES fpMenuItems (ID), " +
                              "[StartPublishing] [datetime] NULL, " +
                              "[EndPublishing] [datetime] NULL, " +
                              "[SortIndex] [int] NOT NULL, " +
                              "[LinkType] [nvarchar](20) NOT NULL, " +
                              "[Target] [nvarchar](20) NULL, " +
                              "[PageID] [int] NULL REFERENCES fpPages (ID), " +
                              "[MediaFileID] [int] NULL REFERENCES fpMediaFiles (ID)" +
                              ")");
            Dam.ExecuteQuery("CREATE TABLE [fpMenuItemTranslations] (" +
                              "[MenuItemID] [int] NOT NULL REFERENCES fpMenuItems (ID), " +
                              "[LocaleID] [int] NOT NULL REFERENCES fpLocales (ID), " +
                              "[Name] [nvarchar](255) NOT NULL, " +
                              "[Url] [nvarchar](max) NULL, " +
                              "CONSTRAINT PK_fpMenuItemTranslations PRIMARY KEY (MenuItemID, LocaleID)" +
                              ")");
            Dam.ExecuteQuery("ALTER TABLE [fpAdministrators] ADD [SelectedFolderID] [int] NOT NULL DEFAULT (-1)");
            Dam.ExecuteQuery("ALTER TABLE [fpAdministrators] ADD [SelectedMediaFolderID] [int] NOT NULL DEFAULT (-1)");
        }
        
        public override void Patch_0_7_10180_115()
        {
            Dam.ExecuteQuery("ALTER TABLE [fpVisitedAdminUrls] ALTER COLUMN [Url] [nvarchar](max) NOT NULL");
        }
        
        public override void Patch_0_7_10175_107()
        {
            Dam.ExecuteQuery("ALTER TABLE [fpPageLocalizedProperties] ADD [Description] [nvarchar](max) NULL");
            Dam.ExecuteQuery("ALTER TABLE [fpPageLocalizedProperties] ADD [Keywords] [nvarchar](max) NULL");
        }
        
        public override void Patch_0_7_10175_105()
        {
        }
        
        public override void Patch_0_7_10175_104()
        {
            Dam.ExecuteQuery("ALTER TABLE [fpAdministrators] ADD [DateFormat] [nvarchar](20) NULL");
            Dam.ExecuteQuery("ALTER TABLE [fpAdministrators] ADD [TimeFormat] [nvarchar](20) NULL");
        }
        
        public override void Patch_0_7_10175_103()
        {
            string sql = "CREATE TABLE [fpPageLocalizedProperties] (" +
                         "[PageID] [int] NOT NULL REFERENCES fpPages (ID), " +
                         "[LocaleID] [int] NOT NULL REFERENCES fpLocales (ID), " +
                         "[Title] [nvarchar](255) NULL, " +
                         "CONSTRAINT PK_fpPageLocalizedProperties PRIMARY KEY (PageID, LocaleID)" +
                         ")";
            Dam.ExecuteQuery(sql);
        }
        
        public override void Patch_0_7_10173_95()
        {
        }
        
        public override void Patch_0_7_10172_94()
        {
            string sql = "CREATE TABLE [fpPageCategories] (" +
                         "[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, " +
                         "[Name] [nvarchar](255) NOT NULL, " +
                         "[SiteID] [int] NOT NULL REFERENCES fpSites (ID)" +
                         ")";
            Dam.ExecuteQuery(sql);
            sql = "CREATE TABLE [fpAssociatedPageCategories] (" +
                  "[CategoryID] [int] NOT NULL REFERENCES fpPageCategories (ID), " +
                  "[PageID] [int] NOT NULL REFERENCES fpPages (ID), " +
                  "CONSTRAINT PK_fpAssociatedPageCategories PRIMARY KEY (CategoryID, PageID)" +
                  ")";
            Dam.ExecuteQuery(sql);
            sql = "CREATE TABLE [fpAssociatedFolderPageCategories] (" +
                  "[CategoryID] [int] NOT NULL REFERENCES fpPageCategories (ID), " +
                  "[FolderID] [int] NOT NULL REFERENCES fpFolders (ID), " +
                  "CONSTRAINT PK_fpAssociatedPageFolderCategories PRIMARY KEY (CategoryID, FolderID)" +
                  ")";
            Dam.ExecuteQuery(sql);
            sql = "ALTER TABLE fpPages ADD [SortKey] [nvarchar](255) NULL";
            Dam.ExecuteQuery(sql);
            sql = "ALTER TABLE fpPages ALTER COLUMN [HeadHtml] [nvarchar](max) NULL";
            Dam.ExecuteQuery(sql);
            sql = "ALTER TABLE fpPages ALTER COLUMN [BodyTopHtml] [nvarchar](max) NULL";
            Dam.ExecuteQuery(sql);
            sql = "ALTER TABLE fpPages ALTER COLUMN [BodyBottomHtml] [nvarchar](max) NULL";
            Dam.ExecuteQuery(sql);
        }
        
        public override void Patch_0_7_10172_93()
        {
        }
    }
}